\(\int (a+b \sec (c+d x)) \tan ^4(c+d x) \, dx\) [265]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 73 \[ \int (a+b \sec (c+d x)) \tan ^4(c+d x) \, dx=a x+\frac {3 b \text {arctanh}(\sin (c+d x))}{8 d}-\frac {(8 a+3 b \sec (c+d x)) \tan (c+d x)}{8 d}+\frac {(4 a+3 b \sec (c+d x)) \tan ^3(c+d x)}{12 d} \]

[Out]

a*x+3/8*b*arctanh(sin(d*x+c))/d-1/8*(8*a+3*b*sec(d*x+c))*tan(d*x+c)/d+1/12*(4*a+3*b*sec(d*x+c))*tan(d*x+c)^3/d

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3966, 3855} \[ \int (a+b \sec (c+d x)) \tan ^4(c+d x) \, dx=\frac {\tan ^3(c+d x) (4 a+3 b \sec (c+d x))}{12 d}-\frac {\tan (c+d x) (8 a+3 b \sec (c+d x))}{8 d}+a x+\frac {3 b \text {arctanh}(\sin (c+d x))}{8 d} \]

[In]

Int[(a + b*Sec[c + d*x])*Tan[c + d*x]^4,x]

[Out]

a*x + (3*b*ArcTanh[Sin[c + d*x]])/(8*d) - ((8*a + 3*b*Sec[c + d*x])*Tan[c + d*x])/(8*d) + ((4*a + 3*b*Sec[c +
d*x])*Tan[c + d*x]^3)/(12*d)

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3966

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[(-e)*(e*Cot
[c + d*x])^(m - 1)*((a*m + b*(m - 1)*Csc[c + d*x])/(d*m*(m - 1))), x] - Dist[e^2/m, Int[(e*Cot[c + d*x])^(m -
2)*(a*m + b*(m - 1)*Csc[c + d*x]), x], x] /; FreeQ[{a, b, c, d, e}, x] && GtQ[m, 1]

Rubi steps \begin{align*} \text {integral}& = \frac {(4 a+3 b \sec (c+d x)) \tan ^3(c+d x)}{12 d}-\frac {1}{4} \int (4 a+3 b \sec (c+d x)) \tan ^2(c+d x) \, dx \\ & = -\frac {(8 a+3 b \sec (c+d x)) \tan (c+d x)}{8 d}+\frac {(4 a+3 b \sec (c+d x)) \tan ^3(c+d x)}{12 d}+\frac {1}{8} \int (8 a+3 b \sec (c+d x)) \, dx \\ & = a x-\frac {(8 a+3 b \sec (c+d x)) \tan (c+d x)}{8 d}+\frac {(4 a+3 b \sec (c+d x)) \tan ^3(c+d x)}{12 d}+\frac {1}{8} (3 b) \int \sec (c+d x) \, dx \\ & = a x+\frac {3 b \text {arctanh}(\sin (c+d x))}{8 d}-\frac {(8 a+3 b \sec (c+d x)) \tan (c+d x)}{8 d}+\frac {(4 a+3 b \sec (c+d x)) \tan ^3(c+d x)}{12 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.60 \[ \int (a+b \sec (c+d x)) \tan ^4(c+d x) \, dx=\frac {a \arctan (\tan (c+d x))}{d}+\frac {3 b \text {arctanh}(\sin (c+d x))}{8 d}-\frac {a \tan (c+d x)}{d}+\frac {3 b \sec (c+d x) \tan (c+d x)}{8 d}-\frac {3 b \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {a \tan ^3(c+d x)}{3 d}+\frac {b \sec (c+d x) \tan ^3(c+d x)}{d} \]

[In]

Integrate[(a + b*Sec[c + d*x])*Tan[c + d*x]^4,x]

[Out]

(a*ArcTan[Tan[c + d*x]])/d + (3*b*ArcTanh[Sin[c + d*x]])/(8*d) - (a*Tan[c + d*x])/d + (3*b*Sec[c + d*x]*Tan[c
+ d*x])/(8*d) - (3*b*Sec[c + d*x]^3*Tan[c + d*x])/(4*d) + (a*Tan[c + d*x]^3)/(3*d) + (b*Sec[c + d*x]*Tan[c + d
*x]^3)/d

Maple [A] (verified)

Time = 1.50 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.42

method result size
derivativedivides \(\frac {a \left (\frac {\tan \left (d x +c \right )^{3}}{3}-\tan \left (d x +c \right )+d x +c \right )+b \left (\frac {\sin \left (d x +c \right )^{5}}{4 \cos \left (d x +c \right )^{4}}-\frac {\sin \left (d x +c \right )^{5}}{8 \cos \left (d x +c \right )^{2}}-\frac {\sin \left (d x +c \right )^{3}}{8}-\frac {3 \sin \left (d x +c \right )}{8}+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(104\)
default \(\frac {a \left (\frac {\tan \left (d x +c \right )^{3}}{3}-\tan \left (d x +c \right )+d x +c \right )+b \left (\frac {\sin \left (d x +c \right )^{5}}{4 \cos \left (d x +c \right )^{4}}-\frac {\sin \left (d x +c \right )^{5}}{8 \cos \left (d x +c \right )^{2}}-\frac {\sin \left (d x +c \right )^{3}}{8}-\frac {3 \sin \left (d x +c \right )}{8}+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(104\)
parts \(\frac {a \left (\frac {\tan \left (d x +c \right )^{3}}{3}-\tan \left (d x +c \right )+\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {b \left (\frac {\sin \left (d x +c \right )^{5}}{4 \cos \left (d x +c \right )^{4}}-\frac {\sin \left (d x +c \right )^{5}}{8 \cos \left (d x +c \right )^{2}}-\frac {\sin \left (d x +c \right )^{3}}{8}-\frac {3 \sin \left (d x +c \right )}{8}+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) \(109\)
risch \(a x +\frac {i \left (15 b \,{\mathrm e}^{7 i \left (d x +c \right )}-48 a \,{\mathrm e}^{6 i \left (d x +c \right )}-9 b \,{\mathrm e}^{5 i \left (d x +c \right )}-96 a \,{\mathrm e}^{4 i \left (d x +c \right )}+9 b \,{\mathrm e}^{3 i \left (d x +c \right )}-80 a \,{\mathrm e}^{2 i \left (d x +c \right )}-15 b \,{\mathrm e}^{i \left (d x +c \right )}-32 a \right )}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}+\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 d}-\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 d}\) \(150\)

[In]

int((a+b*sec(d*x+c))*tan(d*x+c)^4,x,method=_RETURNVERBOSE)

[Out]

1/d*(a*(1/3*tan(d*x+c)^3-tan(d*x+c)+d*x+c)+b*(1/4*sin(d*x+c)^5/cos(d*x+c)^4-1/8*sin(d*x+c)^5/cos(d*x+c)^2-1/8*
sin(d*x+c)^3-3/8*sin(d*x+c)+3/8*ln(sec(d*x+c)+tan(d*x+c))))

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.53 \[ \int (a+b \sec (c+d x)) \tan ^4(c+d x) \, dx=\frac {48 \, a d x \cos \left (d x + c\right )^{4} + 9 \, b \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 9 \, b \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (32 \, a \cos \left (d x + c\right )^{3} + 15 \, b \cos \left (d x + c\right )^{2} - 8 \, a \cos \left (d x + c\right ) - 6 \, b\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \]

[In]

integrate((a+b*sec(d*x+c))*tan(d*x+c)^4,x, algorithm="fricas")

[Out]

1/48*(48*a*d*x*cos(d*x + c)^4 + 9*b*cos(d*x + c)^4*log(sin(d*x + c) + 1) - 9*b*cos(d*x + c)^4*log(-sin(d*x + c
) + 1) - 2*(32*a*cos(d*x + c)^3 + 15*b*cos(d*x + c)^2 - 8*a*cos(d*x + c) - 6*b)*sin(d*x + c))/(d*cos(d*x + c)^
4)

Sympy [F]

\[ \int (a+b \sec (c+d x)) \tan ^4(c+d x) \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right ) \tan ^{4}{\left (c + d x \right )}\, dx \]

[In]

integrate((a+b*sec(d*x+c))*tan(d*x+c)**4,x)

[Out]

Integral((a + b*sec(c + d*x))*tan(c + d*x)**4, x)

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.40 \[ \int (a+b \sec (c+d x)) \tan ^4(c+d x) \, dx=\frac {16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, d x + 3 \, c - 3 \, \tan \left (d x + c\right )\right )} a + 3 \, b {\left (\frac {2 \, {\left (5 \, \sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} + 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{48 \, d} \]

[In]

integrate((a+b*sec(d*x+c))*tan(d*x+c)^4,x, algorithm="maxima")

[Out]

1/48*(16*(tan(d*x + c)^3 + 3*d*x + 3*c - 3*tan(d*x + c))*a + 3*b*(2*(5*sin(d*x + c)^3 - 3*sin(d*x + c))/(sin(d
*x + c)^4 - 2*sin(d*x + c)^2 + 1) + 3*log(sin(d*x + c) + 1) - 3*log(sin(d*x + c) - 1)))/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 172 vs. \(2 (67) = 134\).

Time = 0.93 (sec) , antiderivative size = 172, normalized size of antiderivative = 2.36 \[ \int (a+b \sec (c+d x)) \tan ^4(c+d x) \, dx=\frac {24 \, {\left (d x + c\right )} a + 9 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 9 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (24 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 9 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 104 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 33 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 104 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 33 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 9 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{24 \, d} \]

[In]

integrate((a+b*sec(d*x+c))*tan(d*x+c)^4,x, algorithm="giac")

[Out]

1/24*(24*(d*x + c)*a + 9*b*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 9*b*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + 2*(24
*a*tan(1/2*d*x + 1/2*c)^7 - 9*b*tan(1/2*d*x + 1/2*c)^7 - 104*a*tan(1/2*d*x + 1/2*c)^5 + 33*b*tan(1/2*d*x + 1/2
*c)^5 + 104*a*tan(1/2*d*x + 1/2*c)^3 + 33*b*tan(1/2*d*x + 1/2*c)^3 - 24*a*tan(1/2*d*x + 1/2*c) - 9*b*tan(1/2*d
*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^4)/d

Mupad [B] (verification not implemented)

Time = 15.24 (sec) , antiderivative size = 267, normalized size of antiderivative = 3.66 \[ \int (a+b \sec (c+d x)) \tan ^4(c+d x) \, dx=\frac {2\,a\,\mathrm {atan}\left (\frac {64\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a^3+9\,a\,b^2}+\frac {9\,a\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a^3+9\,a\,b^2}\right )}{d}+\frac {3\,b\,\mathrm {atanh}\left (\frac {27\,b^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,\left (24\,a^2\,b+\frac {27\,b^3}{8}\right )}+\frac {24\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{24\,a^2\,b+\frac {27\,b^3}{8}}\right )}{4\,d}-\frac {\left (\frac {3\,b}{4}-2\,a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {26\,a}{3}-\frac {11\,b}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-\frac {26\,a}{3}-\frac {11\,b}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (2\,a+\frac {3\,b}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \]

[In]

int(tan(c + d*x)^4*(a + b/cos(c + d*x)),x)

[Out]

(2*a*atan((64*a^3*tan(c/2 + (d*x)/2))/(9*a*b^2 + 64*a^3) + (9*a*b^2*tan(c/2 + (d*x)/2))/(9*a*b^2 + 64*a^3)))/d
 + (3*b*atanh((27*b^3*tan(c/2 + (d*x)/2))/(8*(24*a^2*b + (27*b^3)/8)) + (24*a^2*b*tan(c/2 + (d*x)/2))/(24*a^2*
b + (27*b^3)/8)))/(4*d) - (tan(c/2 + (d*x)/2)*(2*a + (3*b)/4) - tan(c/2 + (d*x)/2)^7*(2*a - (3*b)/4) - tan(c/2
 + (d*x)/2)^3*((26*a)/3 + (11*b)/4) + tan(c/2 + (d*x)/2)^5*((26*a)/3 - (11*b)/4))/(d*(6*tan(c/2 + (d*x)/2)^4 -
 4*tan(c/2 + (d*x)/2)^2 - 4*tan(c/2 + (d*x)/2)^6 + tan(c/2 + (d*x)/2)^8 + 1))